package com.qfedu.shardingjdbc.service.impl;

import com.qfedu.shardingjdbc.dao.WorkLogDao;
import com.qfedu.shardingjdbc.entity.WorkLog;
import com.qfedu.shardingjdbc.service.WorkLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * 千锋Java,为你而生！
 *
 * @Author: Feri
 * @Date:2024/11/29 15:54
 * @Modified:
 */
@Service
public class WorkLogServiceImpl implements WorkLogService {
    @Resource
    private WorkLogDao dao;

    @Override
    public String add(WorkLog workLog) {
        workLog.setCreateTime(new Date());

        return dao.insert(workLog)>0?"新增成功":"新增失败！";
    }

    @Override
    public List<WorkLog> queryAll() {
        return dao.selectList(null);
    }
}
